home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Tutorial / Cookbook / 28.Motion / drawObjects.c < prev    next >
C/C++ Source or Header  |  1995-06-12  |  4KB  |  123 lines

  1. /* drawObjects.c generated from drawObjects.psw
  2.    by unix pswrap V1.009  Wed Apr 19 17:50:24 PDT 1989
  3.  */
  4.  
  5. #include <dpsclient/dpsfriends.h>
  6. #include <string.h>
  7.  
  8. #line 1 "drawObjects.psw"
  9. #line 10 "drawObjects.c"
  10. void doBall(float x, float y, float width)
  11. {
  12.   typedef struct {
  13.     unsigned char tokenType;
  14.     unsigned char topLevelCount;
  15.     unsigned short nBytes;
  16.  
  17.     DPSBinObjReal obj0;
  18.     DPSBinObjReal obj1;
  19.     DPSBinObjReal obj2;
  20.     DPSBinObjReal obj3;
  21.     DPSBinObjReal obj4;
  22.     DPSBinObjGeneric obj5;
  23.     DPSBinObjGeneric obj6;
  24.     } _dpsQ;
  25.   static const _dpsQ _dpsStat = {
  26.     DPS_DEF_TOKENTYPE, 7, 60,
  27.     {DPS_LITERAL|DPS_REAL, 0, 0, 0},    /* param: x */
  28.     {DPS_LITERAL|DPS_REAL, 0, 0, 0},    /* param: y */
  29.     {DPS_LITERAL|DPS_REAL, 0, 0, 0},    /* param: width */
  30.     {DPS_LITERAL|DPS_REAL, 0, 0, 0.0},
  31.     {DPS_LITERAL|DPS_REAL, 0, 0, 360.0},
  32.     {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 5},    /* arc */
  33.     {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 66},    /* fill */
  34.     }; /* _dpsQ */
  35.   _dpsQ _dpsF;    /* local copy  */
  36.   register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
  37.   char pad[3];
  38.   register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
  39.   _dpsF = _dpsStat;    /* assign automatic variable */
  40.  
  41.   _dpsP[0].val.realVal = x;
  42.   _dpsP[1].val.realVal = y;
  43.   _dpsP[2].val.realVal = width;
  44.   DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,60);
  45.   if (0) *pad = 0;    /* quiets compiler warnings */
  46. }
  47. #line 3 "drawObjects.psw"
  48.  
  49. #line 50 "drawObjects.c"
  50. void drawPaddle(float angle, float width)
  51. {
  52.   typedef struct {
  53.     unsigned char tokenType;
  54.     unsigned char topLevelCount;
  55.     unsigned short nBytes;
  56.  
  57.     DPSBinObjGeneric obj0;
  58.     DPSBinObjGeneric obj1;
  59.     DPSBinObjGeneric obj2;
  60.     DPSBinObjGeneric obj3;
  61.     DPSBinObjReal obj4;
  62.     DPSBinObjGeneric obj5;
  63.     DPSBinObjGeneric obj6;
  64.     DPSBinObjGeneric obj7;
  65.     DPSBinObjGeneric obj8;
  66.     DPSBinObjGeneric obj9;
  67.     DPSBinObjGeneric obj10;
  68.     DPSBinObjGeneric obj11;
  69.     DPSBinObjGeneric obj12;
  70.     DPSBinObjGeneric obj13;
  71.     DPSBinObjGeneric obj14;
  72.     DPSBinObjReal obj15;
  73.     DPSBinObjGeneric obj16;
  74.     DPSBinObjGeneric obj17;
  75.     DPSBinObjGeneric obj18;
  76.     DPSBinObjGeneric obj19;
  77.     DPSBinObjGeneric obj20;
  78.     DPSBinObjGeneric obj21;
  79.     DPSBinObjGeneric obj22;
  80.     DPSBinObjGeneric obj23;
  81.     } _dpsQ;
  82.   static const _dpsQ _dpsStat = {
  83.     DPS_DEF_TOKENTYPE, 24, 196,
  84.     {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 78},    /* gsave */
  85.     {DPS_LITERAL|DPS_INT, 0, 0, 40},
  86.     {DPS_LITERAL|DPS_INT, 0, 0, 40},
  87.     {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 173},    /* translate */
  88.     {DPS_LITERAL|DPS_REAL, 0, 0, 0},    /* param: angle */
  89.     {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 110},    /* neg */
  90.     {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 136},    /* rotate */
  91.     {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 111},    /* newpath */
  92.     {DPS_LITERAL|DPS_INT, 0, 0, -45},
  93.     {DPS_LITERAL|DPS_INT, 0, 0, 0},
  94.     {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 107},    /* moveto */
  95.     {DPS_LITERAL|DPS_INT, 0, 0, 90},
  96.     {DPS_LITERAL|DPS_INT, 0, 0, 0},
  97.     {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 133},    /* rlineto */
  98.     {DPS_LITERAL|DPS_INT, 0, 0, 0},
  99.     {DPS_LITERAL|DPS_REAL, 0, 0, 0},    /* param: width */
  100.     {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 110},    /* neg */
  101.     {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 133},    /* rlineto */
  102.     {DPS_LITERAL|DPS_INT, 0, 0, -90},
  103.     {DPS_LITERAL|DPS_INT, 0, 0, 0},
  104.     {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 133},    /* rlineto */
  105.     {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 22},    /* closepath */
  106.     {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 66},    /* fill */
  107.     {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 77},    /* grestore */
  108.     }; /* _dpsQ */
  109.   _dpsQ _dpsF;    /* local copy  */
  110.   register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
  111.   char pad[3];
  112.   register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
  113.   _dpsF = _dpsStat;    /* assign automatic variable */
  114.  
  115.   _dpsP[4].val.realVal = angle;
  116.   _dpsP[15].val.realVal = width;
  117.   DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,196);
  118.   if (0) *pad = 0;    /* quiets compiler warnings */
  119. }
  120. #line 17 "drawObjects.psw"
  121.  
  122.  
  123.